UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rrFPtzO523Ypjqe7bSHHs9YBMquhiTkyNFtCiOoDMpc='
WHERE
key_id = 'f6ff99de2502daf30d062fc6730aad822bdec980f17ea006ccb4c3733d1dc84e'
AND (
token = 'rrFPtzO523Ypjqe7bSHHs9YBMquhiTkyNFtCiOoDMpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)