UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LPswprr6WS9iAsfiBbrS9Ufi4pFLtyhu+WGORggGDOU='
WHERE
key_id = '606886701069cb5d1a83e371e3d3e723ecb1d2066e4b62e9af8c74f918f7aa27'
AND (
token = 'LPswprr6WS9iAsfiBbrS9Ufi4pFLtyhu+WGORggGDOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)