UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cvycfZdlAWiP6u04ajGFj3cFpxZfyHXaW+r7ehWjiQg='
WHERE
key_id = 'b2f9dbcb5232e8cfd8b000156209e130b62f13bf55eba44769798820ff99d8af'
AND (
token = 'cvycfZdlAWiP6u04ajGFj3cFpxZfyHXaW+r7ehWjiQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)