UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bl/SNSiSc5IX00MMh6JxBLRTyTIfkecZPsImyXs41rw='
WHERE
key_id = '378305f8fd913b7537226c318bd843c662628edab76a7e7eb3099f91eac65104'
AND (
token = 'Bl/SNSiSc5IX00MMh6JxBLRTyTIfkecZPsImyXs41rw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)