UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LdFvRCEt4kd9qi4ENYo/+ONn5rOGB20uljE1xTl7wAc=' 
WHERE 
  key_id = 'e2f05386f2896800ea9e4c844a6aabf59bf041e149c8eb166011e4f562170676' 
  AND (
    token = 'LdFvRCEt4kd9qi4ENYo/+ONn5rOGB20uljE1xTl7wAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038