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