UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qBqVhGvozHRf6/6h9ygDIfdU5iU+Pl0jw7mHXMb7rfQ='
WHERE
key_id = '95c0678a700cf61a23246ec4637542692151923cc0098705fd79fd5d1a60ed58'
AND (
token = 'qBqVhGvozHRf6/6h9ygDIfdU5iU+Pl0jw7mHXMb7rfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)