UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ht7aLzcYprO3O/8zRNjGWR7JAL/9yULMPP+rH4fgWrM=' 
WHERE 
  key_id = 'fe51c9610a8835c033582857db14fb4d8c7eeefcb8a73b5241ec97b65621f86c' 
  AND (
    token = 'ht7aLzcYprO3O/8zRNjGWR7JAL/9yULMPP+rH4fgWrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030