UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VUQi3Fs/vbxEzG4RkERT6KPak2tqWrBQ6DOoYkEPu6w=' 
WHERE 
  key_id = 'be1c00c964f2babe258c3c18dae4d8562726de1ec1bb83c4fc9ee894705e8496' 
  AND (
    token = 'VUQi3Fs/vbxEzG4RkERT6KPak2tqWrBQ6DOoYkEPu6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015