UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xkxqHHbS8YDOlzcnWnJ2wVItxzeZu2XBx693644KBQc='
WHERE
key_id = 'e68cbaa2441a028263a66c1d2d77b1a2696d1b66e79de17027aa686f2fd8a5c1'
AND (
token = 'xkxqHHbS8YDOlzcnWnJ2wVItxzeZu2XBx693644KBQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)