UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8TysnOQrjXDnTMj6fRqskgva5rjLd0Ym9GeKojimZzQ='
WHERE
key_id = 'bfad1b015200e2064d2d6fb7dc4d67811a0fa48b9ad5ac1569dc5277626807d2'
AND (
token = '8TysnOQrjXDnTMj6fRqskgva5rjLd0Ym9GeKojimZzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)