UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7YeMM/Je9DTb4hvnuzvskiSFaXItgZdg2p9Ux1jaUy8=' 
WHERE 
  key_id = '5bfd57bf0b4ba7a344974b61ecd82fdb4a65b1b6610c937fdc393537b654980e' 
  AND (
    token = '7YeMM/Je9DTb4hvnuzvskiSFaXItgZdg2p9Ux1jaUy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037