UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5wEfzB4ay33YfRE+gdZZn8pFzPwK6bhgd4WhrnONvDU='
WHERE
key_id = 'ec2d334a5a1979c708402b4f70a3db8ed7efbe273bcd1d7d404c984d491cca53'
AND (
token = '5wEfzB4ay33YfRE+gdZZn8pFzPwK6bhgd4WhrnONvDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)