UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O95VEBASW9mHG+UkH4a20oN1xujuVgdwc0D6PTjOixk=' 
WHERE 
  key_id = 'd8743b24f3d99cec8f4a445c855068cd52c9efa1cd5631272e8cfefdef47e74c' 
  AND (
    token = 'O95VEBASW9mHG+UkH4a20oN1xujuVgdwc0D6PTjOixk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067