UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ui57NxXiU/XRGjJEnTATKtt4Xro1h0KWPSw4xkJQzyU='
WHERE
key_id = '698f0315bdbd318007d2e2e7f30ef5c26cbacbdd8fece0434d73ebe6d03554d8'
AND (
token = 'Ui57NxXiU/XRGjJEnTATKtt4Xro1h0KWPSw4xkJQzyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)