UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/vwtUUae56ScXAcdgL8HEdvOV+Q9FmZ599mzOXd+cMY=' 
WHERE 
  key_id = 'fe6b696eae674c2c91a5ce3eccfe26efaa1ab52ffef3c46add20839257e7b22f' 
  AND (
    token = '/vwtUUae56ScXAcdgL8HEdvOV+Q9FmZ599mzOXd+cMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019