UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OyQssN6R29R921dkc20Zc7wOhDZE+xp7Id5Up37wVyM=' 
WHERE 
  key_id = '2ea0ec0e6794e6e65a5a3817f551a4fe2838d8429aea737231f7dd2e08535c40' 
  AND (
    token = 'OyQssN6R29R921dkc20Zc7wOhDZE+xp7Id5Up37wVyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00096