UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2R/lF7DZYKh7czTGZqtNOM7yxQKmt9SC0tR75nweFKM=' 
WHERE 
  key_id = '6dc90669b752c2fac46d0494cf44827b1459ab00200b50aabe9442625659e6b6' 
  AND (
    token = '2R/lF7DZYKh7czTGZqtNOM7yxQKmt9SC0tR75nweFKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046