UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oXTpLfAXUTRa/QvgLT3yi3TenOn1hdVe1QJRnRRiV/I='
WHERE
key_id = '4659404e0b4d7b9e0cec1940730211dbfcbc52e4ab915eee50be05af01abbdf8'
AND (
token = 'oXTpLfAXUTRa/QvgLT3yi3TenOn1hdVe1QJRnRRiV/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)