UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SNtLPrvyclH4fbtVqSZq/B3WX+OdVdVbLr6TDP29F9w='
WHERE
key_id = '3a6be36b3b1275ac03aa77c3f2121ad50f9e90e1554c5b0854c9b7ee2b4d90f6'
AND (
token = 'SNtLPrvyclH4fbtVqSZq/B3WX+OdVdVbLr6TDP29F9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)