UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qSL069nxu/7Du4UDMKTBJHk8bpd/oHvwR6Ca+xPo25w='
WHERE
key_id = '0b9796a163b0c66bac6cf67179c38ff781cc64a8a9159c30151b887703fa6ab1'
AND (
token = 'qSL069nxu/7Du4UDMKTBJHk8bpd/oHvwR6Ca+xPo25w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)