UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C0OTNVME5gyvYxRPasfM28BDr3N/fvxOSfcUPSY4wik='
WHERE
key_id = 'eafdc1e7abde08ffad68ef5ed292c08a115e5c3d858824648fbb93470de9bd11'
AND (
token = 'C0OTNVME5gyvYxRPasfM28BDr3N/fvxOSfcUPSY4wik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)