UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hECI5hmRuJ7Q7yxUxgv3HNoR9+4yzBvuMWfL1zqK3aU='
WHERE
key_id = 'a2463cfc609921ebbcc4e4667992854cd1fbfe66529c970b7d2a424738031bc7'
AND (
token = 'hECI5hmRuJ7Q7yxUxgv3HNoR9+4yzBvuMWfL1zqK3aU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)