UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mPtx1RsK/jPzX8ZK7LIMbqq4LK/osHbbK1ZNNRMkZ2A='
WHERE
key_id = '2fb6f81cdd094ae882b79633c9760dea9331459a9ee27195189ce45e7f68acea'
AND (
token = 'mPtx1RsK/jPzX8ZK7LIMbqq4LK/osHbbK1ZNNRMkZ2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)