UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eBkJa8Ye9Oo2o/X0foW678tn9rq6P/mNYs81u4TobjA='
WHERE
key_id = 'fbe7413f1f6ee9f477ecfb0c45620826813dfbf17a98a804c3eb077a6923b59a'
AND (
token = 'eBkJa8Ye9Oo2o/X0foW678tn9rq6P/mNYs81u4TobjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)