UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cPhXcX56vUfUK+RKnEj+2yXySDdmR9UK3suYsR/5VVg='
WHERE
key_id = '91f21d7a9cc60ffe3f19b17d13c412872c06a18e96ec1ffac0dd18d7f090ca88'
AND (
token = 'cPhXcX56vUfUK+RKnEj+2yXySDdmR9UK3suYsR/5VVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)