UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gPCwUvB6jHXevAyZkBD/exjIx/mNfP6icNf9uTjukJo=' 
WHERE 
  key_id = '00cfaabf6a5ba4a2a395f0ae575239eecb7c998cd01ad5a99aa08c9e9bb652a5' 
  AND (
    token = 'gPCwUvB6jHXevAyZkBD/exjIx/mNfP6icNf9uTjukJo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038