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

Query time 0.00059