UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ae/5DSLb6RMUxAYmMJ62gI6E7yZO0hMfjwxroCU1w54=' 
WHERE 
  key_id = '9e3e4d851e7648161e6e5f29ffc06d419846b90d7d3dde05e0e9860e6642b361' 
  AND (
    token = 'Ae/5DSLb6RMUxAYmMJ62gI6E7yZO0hMfjwxroCU1w54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038