UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yXeWe+pCgLnj0O7knIAJh00FPas9dvEn4Sb0rOjUqQA=' 
WHERE 
  key_id = '49a0de0b1ac5322b1b7f49d4113604e461fb650b44b406891b57e904a89f1081' 
  AND (
    token = 'yXeWe+pCgLnj0O7knIAJh00FPas9dvEn4Sb0rOjUqQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021