UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B//rsCqiyXMEmOmuZ8K3kqVQBkGtJtK4HxLqQvrb8Hk='
WHERE
key_id = '9a6ad3fb06f6c62adf399b2ca2e69ff9103f1039c64aee7a4c4d7c4b538df00f'
AND (
token = 'B//rsCqiyXMEmOmuZ8K3kqVQBkGtJtK4HxLqQvrb8Hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)