UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ijQkdZRRZ3lmZrNSzktmkcRe8X1DxO9A1nh52ExV9g='
WHERE
key_id = 'c18ef30f2d8fe7237dbe58373e9ceb4dca0dab8816f7a6a0112c88d0d1c55a8f'
AND (
token = '7ijQkdZRRZ3lmZrNSzktmkcRe8X1DxO9A1nh52ExV9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)