UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W+BgdPqSfH/JTlT3QC0stt6q68VTA4xE+H5+WE48U9g=' 
WHERE 
  key_id = '1de6fb386e17e2354823ac03487ab0cc53e331144771ff8189f7d41c8c869a9a' 
  AND (
    token = 'W+BgdPqSfH/JTlT3QC0stt6q68VTA4xE+H5+WE48U9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00082