UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2rvxlYaxJ5k8Iqxk0K8KtMBCQe7kfvH1qfrY/y2EMsk=' 
WHERE 
  key_id = '126a07ace5dec3f19e287666cb5c02861b863dab979faca69b938eef24da31f1' 
  AND (
    token = '2rvxlYaxJ5k8Iqxk0K8KtMBCQe7kfvH1qfrY/y2EMsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019