UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'owKJpB/EsndRWNWHuAFP+SCSoi6y/YsYZl9fDYWX9sc='
WHERE
key_id = '2ab95bf1fadb5216f13bd6dc8c641f27e73bb04ff4fe384d00ce6276aa50aac7'
AND (
token = 'owKJpB/EsndRWNWHuAFP+SCSoi6y/YsYZl9fDYWX9sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)