UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WadzIc8OPqFzNRCuAdrIIcvIfA2mlcpe/W2PfhLKnms='
WHERE
key_id = '3ac71f405e9cba61a011e5a267bbf979f2d37d513c1f6037cf53596859b50fb4'
AND (
token = 'WadzIc8OPqFzNRCuAdrIIcvIfA2mlcpe/W2PfhLKnms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)