UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UpKgKQLFYqPjbkzKRLaX9QCgKdMAkWVf8ZM2JxAv57Q=' 
WHERE 
  key_id = '41de0d43839549ecef20e20b1dfd37bf5c9cfeec10568fb79e674eb45432215f' 
  AND (
    token = 'UpKgKQLFYqPjbkzKRLaX9QCgKdMAkWVf8ZM2JxAv57Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026