UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ylY2JLAsWh/TxU53cuXaDONFl9Uc3i3i4xlSuIjA/Us=' 
WHERE 
  key_id = 'f939d4889f42232700dbd63e3d5613f0e162fed3afa89a5b65aa763fceb50a24' 
  AND (
    token = 'ylY2JLAsWh/TxU53cuXaDONFl9Uc3i3i4xlSuIjA/Us=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017