UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pz91gqiiRSsDee7vWe1byKnNAg0laHt1wNvMPA7gNYA='
WHERE
key_id = '3fb9b13e16c4e0f603a53ee760f958380bb240abbf11b402253d1dd18b8a8ef0'
AND (
token = 'pz91gqiiRSsDee7vWe1byKnNAg0laHt1wNvMPA7gNYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)