UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't5wSyXY2dlvMNaKYwiMdHXPrpoNIRY08n1Kbv9E7eak='
WHERE
key_id = '1089f208dce78bef238af13150440081de4f1b21fec6ee3dfa2e1852fc3d5bf1'
AND (
token = 't5wSyXY2dlvMNaKYwiMdHXPrpoNIRY08n1Kbv9E7eak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)