UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FGyeocYsVS53Zg5LlrraO6VnWxLmZAgN0V2k8Z57Isg=' 
WHERE 
  key_id = 'bb1f46562982e979a02a150f86d8599a0d867568673d8ce7d0fc248616bd79d3' 
  AND (
    token = 'FGyeocYsVS53Zg5LlrraO6VnWxLmZAgN0V2k8Z57Isg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050