UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pZ7WdjSWIcekvglz2EW9XpJNMQ+r+wyKlQYqwHg6Vew='
WHERE
key_id = '9110703b57e43402990a7ff9bf57ea0cec2fe169647a63f3a20c4706dc47235e'
AND (
token = 'pZ7WdjSWIcekvglz2EW9XpJNMQ+r+wyKlQYqwHg6Vew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)