UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'is7XOx2q8nNxdAGy1NI149rRgccvg+8Gw13KOJS6vIg='
WHERE
key_id = 'b86dab00ef12248bbf169a225eb7343922ca833029d4421e7733597367649b2d'
AND (
token = 'is7XOx2q8nNxdAGy1NI149rRgccvg+8Gw13KOJS6vIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)