UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KBoPK4q0Li8n+FE/9rrLksG3UIVgFzlQutJTnvh4TNc='
WHERE
key_id = 'ff11425ef73a58234feb9f15d18af5d9f2606ec94ccc02af4bd2297d9269ba45'
AND (
token = 'KBoPK4q0Li8n+FE/9rrLksG3UIVgFzlQutJTnvh4TNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)