UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yZ7+5KZNm5vvI+xmfFqNT+uTNZPDkCcAsXNLt4kLxTI='
WHERE
key_id = '916508269944e1aa704b6400a5c0aaf29817f367b62a6e0e1f0bd0cfb0f06597'
AND (
token = 'yZ7+5KZNm5vvI+xmfFqNT+uTNZPDkCcAsXNLt4kLxTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)