UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Fq+W2XURWdKGDUthH8F0dP1YtLOkKTZ+rovu7BDWC0='
WHERE
key_id = 'e2f3a6cf60aaea01b1f608ef088c96493f4825b95f127ebe16e251440be06d37'
AND (
token = '6Fq+W2XURWdKGDUthH8F0dP1YtLOkKTZ+rovu7BDWC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)